import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/home',
            component: () => import('../components/common/Home.vue'),
            // meta: { title: '自述文件' },
            children: [
                // 快递员路由配置
                {
                    path: '/staffDashBoard',
                    component: () => import( '../components/page/staff/Dashboard.vue'),
                    meta: { title: '系统首页' ,staff:true}
                },
            
                {
                    path: '/staffSystemNotice',
                    component: () => import( '../components/page/staff/SystemNotice.vue'),
                    meta: { title: '系统通知',staff:true }
                },
                {
                    path: '/ExpressInfo',
                    component: () => import( '../components/page/staff/ExpressInfo.vue'),
                    meta: { title: '快递信息',staff:true }
                },
                {
                    path: '/Import',
                    component: () => import( '../components/page/staff/Import.vue'),
                    meta: { title: '快递入库',staff:true }
                },
                {
                    path: '/Export',
                    component: () => import( '../components/page/staff/Export.vue'),
                    meta: { title: '快递出库',staff:true }
                },
                {
                    path: '/ConfirmAppointment',
                    component: () => import( '../components/page/staff/ConfirmAppointment.vue'),
                    meta: { title: '寄件预约',staff:true }
                },
                {
                    path: '/PackageStranded',
                    component: () => import( '../components/page/staff/PackageStranded.vue'),
                    meta: { title: '包裹滞留' ,staff:true}
                },
                {
                    path: '/PickUpCodeManagement',
                    component: () => import( '../components/page/staff/PickUpCodeManagement.vue'),
                    meta: { title: '取货码管理'  ,staff:true}
                },
                {
                    path: '/InfoModify',
                    component: () => import( '../components/page/staff/InfoModify.vue'),
                    meta: { title: '信息完善' ,staff:true }
                },
                {
                    path: '/UpdatePwd',
                    component: () => import( '../components/page/staff/UpdatePwd.vue'),
                    meta: { title: '修改密码' ,staff:true }
                },
                // 用户路由配置
                {
                    path: '/userDashBoard',
                    component: () => import( '../components/page/user/Dashboard.vue'),
                    meta: { title: '我的首页',user:true }
                },
            
                {
                    path: '/userSystemNotice',
                    component: () => import( '../components/page/user/SystemNotice.vue'),
                    meta: { title: '我的通知',user:true  }
                },
                {
                    path: '/MakeAppointment',
                    component: () => import( '../components/page/user/MakeAppointment.vue'),
                    meta: { title: '上门预约',user:true  }
                },
                {
                    path: '/MyAppointment',
                    component: () => import( '../components/page/user/MyAppointment.vue'),
                    meta: { title: '我的预约',user:true  }
                },
                {
                    path: '/MyPackage',
                    component: () => import( '../components/page/user/MyPackage.vue'),
                    meta: { title: '我的包裹',user:true  }
                },
                {
                    path: '/PackageRefused',
                    component: () => import( '../components/page/user/PackageRefused.vue'),
                    meta: { title: '包裹拒签' ,user:true }
                },
                {
                    path: '/SendPackage',
                    component: () => import( '../components/page/user/SendPackage.vue'),
                    meta: { title: '寄件' ,user:true }
                },

                  // 管理员路由配置
                  {
                    path: '/adminDashBoard',
                    component: () => import( '../components/page/boss/Dashboard.vue'),
                    meta: { title: '系统首页' ,admin:true}
                },
                {
                    path: '/adminSystemNotice',
                    component: () => import( '../components/page/boss/SystemNotice.vue'),
                    meta: { title: '系统通知' ,admin:true}
                },
               
                {
                    path: '/CompanyManagement',
                    component: () => import( '../components/page/boss/CompanyManagement.vue'),
                    meta: { title: '公司管理' ,admin:true }
                },
                {
                    path: '/DailyStatistics',
                    component: () => import( '../components/page/boss/DailyStatistics.vue'),
                    meta: { title: '每日统计' ,admin:true }
                },
                {
                    path: '/MonthlyStatistics',
                    component: () => import( '../components/page/boss/MonthlyStatistics.vue'),
                    meta: { title: '每月统计'  ,admin:true}
                },
                {
                    path: '/adminPickUpCodeManagement',
                    component: () => import( '../components/page/boss/PickUpCodeManagement.vue'),
                    meta: { title: '货码管理'  ,admin:true}
                },
              
                {
                    path: '/StaffManagement',
                    component: () => import( '../components/page/boss/StaffManagement.vue'),
                    meta: { title: '员工管理' ,admin:true }
                },
                {
                    path: '/UserManagement',
                    component: () => import( '../components/page/boss/UserManagement.vue'),
                    meta: { title: '用户管理' ,admin:true }
                }, 
 // 公共访问路由配置
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "login" */ '../components/page/pub/403.vue'),
                    meta: { title: '无权访问' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "login" */ '../components/page/pub/404.vue'),
                    meta: { title: '页面不存在' }
                },
            ]
        },
         // 公共访问路由配置
        {
            path: '/LoginAndRegister',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/pub/LoginAndRegister.vue'),
            meta: { title: '登录和注册' }
        },
        {
            path: '/',
            redirect: '/LoginAndRegister'
        },
       
    ]
});
